<?php
// application/Bootstrap.php

require_once 'ModuleLayoutPlugin.php';
require_once 'EMag/Plugin/Site.php';
require_once 'EMag/UserSession.php';

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    public function run()
    {
        $this->bootstrap('frontController');

        $layoutModulePlugin = new Module_LayoutPlugin();
        $layoutModulePlugin->disableModuleLayout('static');
        $layoutModulePlugin->registerModuleLayout('test', APPLICATION_PATH.'/modules/test/layouts');
        $layoutModulePlugin->registerModuleLayout('widget', APPLICATION_PATH.'/modules/widget/layouts');
        $layoutModulePlugin->registerModuleLayout('sites', APPLICATION_PATH.'/modules/sites/layouts');
        $layoutModulePlugin->registerModuleLayout('siteadmin', APPLICATION_PATH.'/modules/siteadmin/layouts');

        $this->frontController->registerPlugin($layoutModulePlugin);
        $this->frontController->registerPlugin(new EMag_Plugin_Site());
        $this->frontController->dispatch();

    }

    protected function _initAutoload()
    {
        $autoloader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Default_',
            'basePath'  => dirname(__FILE__),
        ));

        return $autoloader;
    }

    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        ZendX_JQuery::enableView($view);
        $view->doctype('XHTML1_STRICT');
    }
}

?>